<?php
/*
 *      osmetafield.php
 *
 *      Copyright 2010 Vitaliy Rakitin <virak@ukr.net>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
*/

class osmetafield {

	protected $uuid;
	protected $type;
	protected $length;
	protected $name;
	protected $luobject;
	protected $ludisplay;
	//protected $onchange;
	protected $defaultvalue;
	protected $isprimary;
	public $beforechange;
	public $afterchange;

	function __construct($uuid) {
		$this->uuid = $uuid;
	}

	function __get($name) {
		switch ($name) {
			case "name": { return $this->name;break;}
			case "isprimary": { return $this->isprimary;break;}
			case "defaultvalue": { return $this->defaultvalue;break;}
			case "type": { return $this->type;break;}
			case "length": { return $this->length;break;}
			case "luobject": { return $this->luobject;break;}
			case "ludisplay": { return $this->ludisplay;break;}
			//case "onchange": { return $this->onchange;break;}
			case "uuid": { return $this->uuid;break;}
		}
	}

	function __set($name, $value) {
		switch ($name) {
			case "name": { $this->name = $value;break;}
			case "defaultvalue": { $this->defaultvalue = $value;break;}
			case "type": { $this->type = $value;break;}
			case "length": { $this->length = $value;break;}
			case "luobject": { $this->luobject = $value;break;}
			case "ludisplay": { $this->ludisplay = $value;break;}
			//case "onchange": { $this->onchange = $value;break;}
			case "isprimary": { $this->isprimary = $value;break;}
		}
	}
}

?>

